package com.example.module_home

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.view.LayoutInflater
import android.webkit.WebChromeClient
import com.example.module_home.databinding.HomeActivityWebDetailBinding

class WebDetailActivity : AppCompatActivity() {

    private lateinit var binding: HomeActivityWebDetailBinding
    private lateinit var webUrl: String

    companion object {
        const val WEB_URL = "web_url"
    }

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        binding = HomeActivityWebDetailBinding.inflate(LayoutInflater.from(this), null, false)
        setContentView(binding.root)
        webUrl = intent.getStringExtra(WEB_URL) as String

        initWebView()
    }

    private fun initWebView() {
        binding.webDetail.apply {
            webChromeClient = WebChromeClient()
            loadUrl(webUrl)

        }
    }


}